home *** CD-ROM | disk | FTP | other *** search
- package sun.print;
-
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.FocusEvent;
- import java.awt.event.FocusListener;
- import java.util.Locale;
- import javax.print.attribute.standard.JobName;
- import javax.print.attribute.standard.JobPriority;
- import javax.print.attribute.standard.JobSheets;
- import javax.print.attribute.standard.RequestingUserName;
- import javax.swing.BorderFactory;
- import javax.swing.JCheckBox;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JSpinner;
- import javax.swing.JTextField;
- import javax.swing.SpinnerNumberModel;
- import javax.swing.event.ChangeEvent;
- import javax.swing.event.ChangeListener;
-
- class ServiceDialog$JobAttributesPanel extends JPanel implements ActionListener, ChangeListener, FocusListener {
- private final String strTitle;
- private JLabel lblPriority;
- private JLabel lblJobName;
- private JLabel lblUserName;
- private JSpinner spinPriority;
- private SpinnerNumberModel snModel;
- private JCheckBox cbJobSheets;
- private JTextField tfJobName;
- private JTextField tfUserName;
- // $FF: synthetic field
- final ServiceDialog this$0;
-
- public ServiceDialog$JobAttributesPanel(ServiceDialog var1) {
- this.this$0 = var1;
- this.strTitle = ServiceDialog.getMsg("border.jobattributes");
- GridBagLayout var2 = new GridBagLayout();
- GridBagConstraints var3 = new GridBagConstraints();
- this.setLayout(var2);
- this.setBorder(BorderFactory.createTitledBorder(this.strTitle));
- var3.fill = 0;
- var3.insets = ServiceDialog.access$700();
- var3.weighty = (double)1.0F;
- this.cbJobSheets = ServiceDialog.access$1000("checkbox.jobsheets", this);
- var3.anchor = 21;
- ServiceDialog.access$300(this.cbJobSheets, this, var2, var3);
- JPanel var4 = new JPanel();
- this.lblPriority = new JLabel(ServiceDialog.getMsg("label.priority"), 11);
- this.lblPriority.setDisplayedMnemonic(ServiceDialog.access$800("label.priority"));
- var4.add(this.lblPriority);
- this.snModel = new SpinnerNumberModel(1, 1, 100, 1);
- this.spinPriority = new JSpinner(this.snModel);
- this.lblPriority.setLabelFor(this.spinPriority);
- ((JSpinner.NumberEditor)this.spinPriority.getEditor()).getTextField().setColumns(3);
- this.spinPriority.addChangeListener(this);
- var4.add(this.spinPriority);
- var3.anchor = 22;
- var3.gridwidth = 0;
- var4.getAccessibleContext().setAccessibleName(ServiceDialog.getMsg("label.priority"));
- ServiceDialog.access$300(var4, this, var2, var3);
- var3.fill = 2;
- var3.anchor = 10;
- var3.weightx = (double)0.0F;
- var3.gridwidth = 1;
- char var5 = ServiceDialog.access$800("label.jobname");
- this.lblJobName = new JLabel(ServiceDialog.getMsg("label.jobname"), 11);
- this.lblJobName.setDisplayedMnemonic(var5);
- ServiceDialog.access$300(this.lblJobName, this, var2, var3);
- var3.weightx = (double)1.0F;
- var3.gridwidth = 0;
- this.tfJobName = new JTextField();
- this.lblJobName.setLabelFor(this.tfJobName);
- this.tfJobName.addFocusListener(this);
- this.tfJobName.setFocusAccelerator(var5);
- this.tfJobName.getAccessibleContext().setAccessibleName(ServiceDialog.getMsg("label.jobname"));
- ServiceDialog.access$300(this.tfJobName, this, var2, var3);
- var3.weightx = (double)0.0F;
- var3.gridwidth = 1;
- char var6 = ServiceDialog.access$800("label.username");
- this.lblUserName = new JLabel(ServiceDialog.getMsg("label.username"), 11);
- this.lblUserName.setDisplayedMnemonic(var6);
- ServiceDialog.access$300(this.lblUserName, this, var2, var3);
- var3.gridwidth = 0;
- this.tfUserName = new JTextField();
- this.lblUserName.setLabelFor(this.tfUserName);
- this.tfUserName.addFocusListener(this);
- this.tfUserName.setFocusAccelerator(var6);
- this.tfUserName.getAccessibleContext().setAccessibleName(ServiceDialog.getMsg("label.username"));
- ServiceDialog.access$300(this.tfUserName, this, var2, var3);
- }
-
- public void actionPerformed(ActionEvent var1) {
- if (this.cbJobSheets.isSelected()) {
- ServiceDialog.access$1200(this.this$0).add(JobSheets.STANDARD);
- } else {
- ServiceDialog.access$1200(this.this$0).add(JobSheets.NONE);
- }
-
- }
-
- public void stateChanged(ChangeEvent var1) {
- ServiceDialog.access$1200(this.this$0).add(new JobPriority(this.snModel.getNumber().intValue()));
- }
-
- public void focusLost(FocusEvent var1) {
- Object var2 = var1.getSource();
- if (var2 == this.tfJobName) {
- ServiceDialog.access$1200(this.this$0).add(new JobName(this.tfJobName.getText(), Locale.getDefault()));
- } else if (var2 == this.tfUserName) {
- ServiceDialog.access$1200(this.this$0).add(new RequestingUserName(this.tfUserName.getText(), Locale.getDefault()));
- }
-
- }
-
- public void focusGained(FocusEvent var1) {
- }
-
- public void updateInfo() {
- Class var1 = JobSheets.class;
- Class var2 = JobPriority.class;
- Class var3 = JobName.class;
- Class var4 = RequestingUserName.class;
- boolean var5 = false;
- boolean var6 = false;
- boolean var7 = false;
- boolean var8 = false;
- if (ServiceDialog.access$400(this.this$0).isAttributeCategorySupported(var1)) {
- var5 = true;
- }
-
- JobSheets var9 = (JobSheets)ServiceDialog.access$1200(this.this$0).get(var1);
- if (var9 == null) {
- var9 = (JobSheets)ServiceDialog.access$400(this.this$0).getDefaultAttributeValue(var1);
- if (var9 == null) {
- var9 = JobSheets.NONE;
- }
- }
-
- this.cbJobSheets.setSelected(var9 != JobSheets.NONE);
- this.cbJobSheets.setEnabled(var5);
- if (!ServiceDialog.access$1500(this.this$0) && ServiceDialog.access$400(this.this$0).isAttributeCategorySupported(var2)) {
- var6 = true;
- }
-
- JobPriority var10 = (JobPriority)ServiceDialog.access$1200(this.this$0).get(var2);
- if (var10 == null) {
- var10 = (JobPriority)ServiceDialog.access$400(this.this$0).getDefaultAttributeValue(var2);
- if (var10 == null) {
- var10 = new JobPriority(1);
- }
- }
-
- int var11 = var10.getValue();
- if (var11 < 1 || var11 > 100) {
- var11 = 1;
- }
-
- this.snModel.setValue(new Integer(var11));
- this.lblPriority.setEnabled(var6);
- this.spinPriority.setEnabled(var6);
- if (ServiceDialog.access$400(this.this$0).isAttributeCategorySupported(var3)) {
- var7 = true;
- }
-
- JobName var12 = (JobName)ServiceDialog.access$1200(this.this$0).get(var3);
- if (var12 == null) {
- var12 = (JobName)ServiceDialog.access$400(this.this$0).getDefaultAttributeValue(var3);
- if (var12 == null) {
- var12 = new JobName("", Locale.getDefault());
- }
- }
-
- this.tfJobName.setText(var12.getValue());
- this.tfJobName.setEnabled(var7);
- this.lblJobName.setEnabled(var7);
- if (!ServiceDialog.access$1500(this.this$0) && ServiceDialog.access$400(this.this$0).isAttributeCategorySupported(var4)) {
- var8 = true;
- }
-
- RequestingUserName var13 = (RequestingUserName)ServiceDialog.access$1200(this.this$0).get(var4);
- if (var13 == null) {
- var13 = (RequestingUserName)ServiceDialog.access$400(this.this$0).getDefaultAttributeValue(var4);
- if (var13 == null) {
- var13 = new RequestingUserName("", Locale.getDefault());
- }
- }
-
- this.tfUserName.setText(var13.getValue());
- this.tfUserName.setEnabled(var8);
- this.lblUserName.setEnabled(var8);
- }
- }
-